# 导包
import unittest

from api.login import LoginAPI1


# 创建测试类
class TestLoginAPI1(unittest.TestCase):
    # 前置处理
    def setUp(self):
        self.login_api1 = LoginAPI1()

    # 测试用例
    def test01_login_success(self):
        response = self.login_api1.login_api({"mobile": "13800000002", "password": "123456"})
        print(response.json())

        # 断言
        self.assertEqual(200, response.status_code)
        self.assertEqual(True, response.json().get("success"))
        self.assertEqual(10000, response.json().get("code"))
        self.assertIn("操作成功", response.json().get("message"))






